//
//  MyFile.h
//  Exam11-1
//
//  Created by 孙晓晔 on 2017/4/14.
//  Copyright © 2017年 孙晓晔. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MyFile : NSObject

@property(nonatomic, strong) NSFileManager *file;
@property(nonatomic, strong) NSString *dir; // 文件操作根目录

-(instancetype)initWithDirectory:(NSString*)dir;

-(BOOL)createDir:(NSString*)dir;
-(NSArray *)listAtPath:(NSString*)folderPath;
-(unsigned long long)folderSizeAtPath:(NSString*)folderPath;

-(BOOL)createFile:(NSString*)path;
-(BOOL)writeFile:(NSString*)path data:(NSData*)data;
-(BOOL)writeFile:(NSString*)path str:(NSString*)str;
-(BOOL)writeFile:(NSString*)path dict:(NSDictionary*)dict;
-(BOOL)writeFile:(NSString*)path arr:(NSArray*)arr;

-(NSString*)readFile:(NSString*)path;

-(BOOL)moveFile:(NSString*)path dstPath:(NSString*)dstPath;
-(BOOL)deleteFile:(NSString*)path;
-(BOOL)isExistAtPath:(NSString *)path;
-(unsigned long long)fileSizeAtPath:(NSString *)path;


@end
